package com.itheima.tlias84.servrce.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.itheima.tlias84.dto.ReportLogDTO;
import com.itheima.tlias84.dto.SelectEmpDTO;
import com.itheima.tlias84.mapper.LogMapper;
import com.itheima.tlias84.mapper.ReportMapper;
import com.itheima.tlias84.po.ReportLogParam;
import com.itheima.tlias84.servrce.ReportLogService;
import com.itheima.tlias84.utils.ResultUtil;
import com.itheima.tlias84.vo.pageVO;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.aspectj.lang.annotation.Around;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@Slf4j
public class ReportLogServiceImpl implements ReportLogService {
    @Resource
    LogMapper logMapper;


    @Override
    public ResultUtil selectLogs(ReportLogParam param) {
        Page<Object> page = PageHelper.startPage(param.getPage(), param.getPageSize(),true);
        List<ReportLogDTO> reportLogDTOS = logMapper.selectLogs(param);
        pageVO<ReportLogDTO> objectpageVO = new pageVO<>();
        objectpageVO.setTotal(page.getTotal());
        objectpageVO.setRows(reportLogDTOS);
        return ResultUtil.success(objectpageVO);
    }




}
